<?php
header ( "Content-Type:text/html; charset=utf-8" );
include '../public/db.php';
@$name=$_REQUEST['name'];
@$psw=$_REQUEST['psw'];
if(empty($name)|empty($psw)){
	echo '{"success":false,"msg":"你填写的信息不完整！"}';
}else{
	$person = select('select * from user where userName=:name',array('name'=>$name));
	if(empty($person)){
		echo '{"success":false,"msg":"用户名不存在！"}';
	}elseif ($psw!=$person['password']){
		echo '{"success":false,"msg":"密码错误！"}';
	}else {
		echo '{"success":true,"msg":"登录成功"}';
	}
}